<?php

	class Shop {
		//获取购物车
		public static function getCart() {
			if(is_string(Yii::app()->user->getState('cart')))
				return json_decode(Yii::app()->user->getState('cart'), true);
			else
				return Yii::app()->user->getState('cart');
		}
        //设置购物车
		public static function setCart($cart) {
			return Yii::app()->user->setState('cart', json_encode($cart));
		}
		//计算总价格
		public static function getPriceTotal() {
			
		}	
	}
